import React,{useState} from 'react'
import { Input,Button,Select  } from 'antd';
const { Option, OptGroup } = Select;


export default function (props) {
    let [value,setValue]=useState("")
    let  [type,setType]=useState("")

    const handleChange = (value) => {
        setType(value)
    };

    const  getVlue=(e)=>{
        setValue(e.target.value)
    }
    const clickSearch=(e)=>{
        console.log(value);
        props.show({type,value})
    }
  return <div style={{display:"flex",marginLeft:"25px"}}>
    <Select
    defaultValue="请选择"
    style={{
      width: 120,
    }}
    onChange={handleChange}
  >
    <OptGroup >
      <Option value="name">昵称</Option>
      <Option value="username">用户名</Option>
      <Option value="gender">性别</Option>
      <Option value="phone">联系电话</Option>
      <Option value="integral">会员积分</Option>
      <Option value="address">地址</Option>
    </OptGroup>
  </Select>
    <Input placeholder="请输入搜索内容"  onChange={getVlue} style={{width:"180px"}}/>
    <Button onClick={clickSearch}>搜索</Button>
  </div>
 
}
